/* 
 * This program is free software; you can redistribute it and/or modify 
 * it under the terms of the GNU General Public License as published by 
 * the Free Software Foundation; either version 3 of the License, or 
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful, but 
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 
 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 
 * for more details.
 * 
 * You should have received a copy of the GNU General Public License along 
 * with this program; if not, write to the Free Software Foundation, Inc., 
 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 */

#ifndef SETTINGSFRAME_H
#define SETTINGSFRAME_H

#include <QDialog>
#include <QEvent>
#include <QSettings>
#include "ui_settingsframe.h"

namespace Wishmaster
{
	class ChanManager;
}

class MainWindow;
class SettingsFrame : public QDialog
{
	Q_OBJECT
public:
	SettingsFrame(MainWindow* mainform, Wishmaster::ChanManager* manager, QWidget* parent = 0);
	virtual ~SettingsFrame();

	void fillForm();

public slots:
	void saveSettings();
	void accept();
	void languageChanged(const QString& language);
	void addTextFilter();
	void editFilter();
	void deleteFilter();
	void wipeFilterToggled(bool b);

	void browsePostStyle();
	void browseNewMessagesSound();

	void notifyNewMessagesStateChanged(bool b);

protected slots:
	void updateNotification();

protected:
	bool event(QEvent* event);
	void refreshFilterList();

	void fillAutorefreshTab(QSettings& settings);
	void saveAutorefreshTab(QSettings& settings);

	void fillConnectionTab(QSettings& settings);
	void saveConnectionTab(QSettings& settings);

	void fillInterfaceTab(QSettings& settings);
	void saveInterfaceTab(QSettings& settings);

private:
	MainWindow* m_mainform;
	Ui::dialog_settings ui;
	QSharedPointer<QWidget> m_notificatorConfig;
	Wishmaster::ChanManager* m_chanmanager;

};

#endif

